import { setBpmnStartEventPropertiesGroups } from "./startEvent";
import { BPMN_START_EVENT_TYPE } from "./type";
import { is } from "bpmn-js/lib/util/ModelUtil";

const component_opts = {
  [BPMN_START_EVENT_TYPE]: setBpmnStartEventPropertiesGroups,
};

/**
 * 加载组件属性组
 * @param {*} groups
 * @param {*} element
 * @param {*} translate
 */
export function loadComponentPropertiesGroup(groups, element, translate) {
  Object.getOwnPropertyNames(component_opts).forEach((componentType) => {
    if (is(element, componentType)) {
      component_opts[componentType](groups, element, translate);
    }
  });
}
